package com.huawei.games.impl;

import com.huawei.games.GamesRules;
import com.huawei.games.ResultOperation;
import com.huawei.pojo.Result;
public class GamesRulesImpl implements GamesRules  {
    @Override
    public com.huawei.result.Result rockPaperScissors(int person, int computer) {
        com.huawei.result.Result result = new com.huawei.result.Result();
        ResultOperation operation = new ResultOperationImpl();
        switch ((person - computer + 3)%3){
            case 0:
                result = operation.rockPaperScissorsByPersonAndComputerDraws();
                break;
            case 1:
                result = operation.rockPaperScissorsByPersonWin();
                break;
            case 2:
                result = operation.rockPaperScissorsByComputerWin();
        }
        return result;
    }

}
